Skip to content

Conversation

albertz
Copy link
Member

@albertz albertz commented Mar 17, 2022

Fix #992.

Maybe also fix #957 (need to test this).

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

The subnet issue described in #957 is maybe like this:

Root net has some CondLayer or MaskedComputationLayer or RecLayer, which itself goes back to the root net.

_NetworkConstructionStack is actually per net but in flat_construct, it catches all _DelayedConstructionException, even for other nets. This is probably wrong.

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

About other exceptions in construct_layer: We placed the flat construction logic later because we want that LayerNotFound is directly raised. We maybe should generalize this. we can effectively catch any raised exceptions, and once construct_layer is called again, it would reraise that earlier exception. Or when called again, then not run into the flat construction but directly construct? Maybe allow construction stack depth 2?

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

Need some comment why nested flat construction is ok. Basically: E.g. in RecLayer, when getting back to base net, we don't want a partial rec template construction to reset. So, it will not be deep w.r.t. to such layers which define new ctx boundaries. But that is not really a problem.

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

The handling of exceptions is problematic, esp together with the Rec template construction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flat net construction should be the default maximum recursion depth exceeded at layer creation, broken flat_net_construction

1 participant